import pygame

# Define some colors
black	= (0, 0, 0)
white	= (255, 255, 255)
green	= (0, 255, 0)
red	= (255, 0, 0)
blue	= (0, 0, 255)
yellow	= (255, 255, 0)

pink	= (255, 20, 147)
orange 	= (255, 69, 0)
brown	= (205, 133, 63)
deep_red = (178, 34, 34)
khaki	= (240, 230, 140)
forest_green = (34, 139, 34)
navy_blue = (0, 0, 128)
gray	= (190, 190, 190)
slate_gray = (49, 79, 79)
antique_white = (250, 235, 215)

# Initialize the game engine
pygame.init()

# Set the height and width of the screen
width	= 800
height	= 600
size 	= [width, height]
screen 	= pygame.display.set_mode(size)

pygame.display.set_caption("Title")

# Loop until the user clicks the close button
done = False
clock = pygame.time.Clock()

fps = 60

# Starting position of the circle
circle_x = 50
circle_y = 50

# Speed and direction of circle
circle_change_x = 5
circle_change_y = 5

#colors = [white, red, blue, green]
# List of colors
colors = [pink, antique_white, orange, brown, khaki, deep_red, forest_green, slate_gray, navy_blue, gray]
i = 0

# Size of ball
size = 100

# ----- Main Program Loop -----
while not done:
	# For everything the user does
	for event in pygame.event.get():
		if event.type == pygame.QUIT:
			done = True

	# Set the screen background
	screen.fill(black)

	# ----- Begin Drawing Something -----

	# Draw the circle
	pygame.draw.ellipse(screen, colors[i], [circle_x, circle_y, size, size], 0)

	# Move the circle starting point
	circle_x += circle_change_x
	circle_y += circle_change_y

	# Bounce the ball if needed
	# If the ball bounces, the color changes to the next one in the list
	if circle_x > (width - size) or circle_x < 0:
		circle_change_x *= -1
		i += 1
	if circle_y > (height - size) or circle_y < 0:
		circle_change_y *= -1
		i += 1

	# Start again from the start if all the colors have been used
	if (i >= len(colors)):
		i = 0

	# ----- End Drawing Something -----

	# Limit to fps frames per second
	clock.tick(fps)

	# Update the screen with what's been drawn
	pygame.display.flip()

# Exit.
pygame.quit()
